package liangtWorkSpace.Observer.HeadFiestObsver;

import liangtWorkSpace.Observer.HeadFiestObsver.display.CurrentConditionsDisplay;
import liangtWorkSpace.Observer.HeadFiestObsver.display.ForecastDisplay;
import liangtWorkSpace.Observer.HeadFiestObsver.display.StatisticsDisplay;
import liangtWorkSpace.Observer.HeadFiestObsver.subject.WeatherData;

/**
 * @ClassName WeatherSubjectMain
 * @Description : Vserion 1.0 版观察者模式气象站展示文本
 * @Author : LiangT
 * @Date : 2020/6/17 20:21
 */
public class WeatherSubjectMain {
    public static void main(String[] args) {
        /* 创建一个气象站 */
        WeatherData weatherData = new WeatherData();
        /* 将布告栏一次注册到气象站中 */
        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
        ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);

        weatherData.setMeasurements(80,65,30.4f);
        weatherData.setMeasurements(82,70,29.2f);
        weatherData.setMeasurements(78,90,30.4f);
    }
}
